//package com.czf.testmodele.time.quartz;
//
//import lombok.extern.slf4j.Slf4j;
//import org.quartz.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.quartz.QuartzJobBean;
//import org.springframework.stereotype.Component;
//
///**
// * @author zfChen
// * @create 2022/6/8 17:43
// */
//@Slf4j
//@Component
//public class PublishPostJob extends QuartzJobBean {
//    @Autowired
//    private IScheduleService scheduleService;
////    @Autowired
////    private IPostsService postsService;
//
//    @Override
//    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
//        Trigger trigger = jobExecutionContext.getTrigger();
//        JobDetail jobDetail = jobExecutionContext.getJobDetail();
//        JobDataMap jobDataMap = jobDetail.getJobDataMap();
//        String data = jobDataMap.getString("data");
//        log.info("定时发布文章操作：{}", data);
////        // 获取文章的 ID后获取文章，更新文章为发布的状态，还有发布的时间
////        boolean success = postsService.updatePostByScheduler(data);
//
//        log.info("定时任务执行成功，开始清除定时任务");
//        scheduleService.cancelScheduleJob(trigger.getKey().getName());
//
//    }
//}
